from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_jwt_extended import JWTManager
import logging

# 配置 SQLAlchemy 日志
logging.basicConfig()
logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO)

db = SQLAlchemy()
migrate = Migrate()
jwt = JWTManager()

def init_app(app):
    # 启用 SQLAlchemy 查询跟踪
    app.config['SQLALCHEMY_ECHO'] = True
    
    db.init_app(app)